package com.laowang.project.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.laowang.project.system.mapper.MyCyhMerchantShareMapper;
import com.laowang.project.system.domain.MyCyhMerchantShare;
import com.laowang.project.system.service.MyCyhMerchantShareService;

/**
 * 商家分享入驻关联Service业务层处理
 *
 * @author laowang
 * @date 2023-08-25
 */
@Service
public class MyCyhMerchantShareServiceImpl implements MyCyhMerchantShareService {
    @Autowired
    private MyCyhMerchantShareMapper myCyhMerchantShareMapper;

    /**
     * 查询商家分享入驻关联
     *
     * @param id 商家分享入驻关联ID
     * @return 商家分享入驻关联
     */
    @Override
    public MyCyhMerchantShare selectMyCyhMerchantShareById(Integer id) {
        return myCyhMerchantShareMapper.selectMyCyhMerchantShareById(id);
    }

    /**
     * 查询商家分享入驻关联列表
     *
     * @param myCyhMerchantShare 商家分享入驻关联
     * @return 商家分享入驻关联
     */
    @Override
    public List<MyCyhMerchantShare> selectMyCyhMerchantShareList(MyCyhMerchantShare myCyhMerchantShare) {
        return myCyhMerchantShareMapper.selectMyCyhMerchantShareList(myCyhMerchantShare);
    }

    /**
     * 新增商家分享入驻关联
     *
     * @param myCyhMerchantShare 商家分享入驻关联
     * @return 结果
     */
    @Override
    public int insertMyCyhMerchantShare(MyCyhMerchantShare myCyhMerchantShare) {
        return myCyhMerchantShareMapper.insertMyCyhMerchantShare(myCyhMerchantShare);
    }

    /**
     * 修改商家分享入驻关联
     *
     * @param myCyhMerchantShare 商家分享入驻关联
     * @return 结果
     */
    @Override
    public int updateMyCyhMerchantShare(MyCyhMerchantShare myCyhMerchantShare) {
        return myCyhMerchantShareMapper.updateMyCyhMerchantShare(myCyhMerchantShare);
    }

    /**
     * 批量删除商家分享入驻关联
     *
     * @param ids 需要删除的商家分享入驻关联ID
     * @return 结果
     */
    @Override
    public int deleteMyCyhMerchantShareByIds(Integer[] ids) {
        return myCyhMerchantShareMapper.deleteMyCyhMerchantShareByIds(ids);
    }

    /**
     * 删除商家分享入驻关联信息
     *
     * @param id 商家分享入驻关联ID
     * @return 结果
     */
    @Override
    public int deleteMyCyhMerchantShareById(Integer id) {
        return myCyhMerchantShareMapper.deleteMyCyhMerchantShareById(id);
    }

    @Override
    public MyCyhMerchantShare selectOneLastByUserId(Integer userId) {
       return  myCyhMerchantShareMapper.selectOneLastByUserId(userId);
    }
}
